class PersonPhotosController < ApplicationController
	include AuthenticatedSystem

	layout "main"
	
	def new		
	end
	
	def create
		@person_photo = PersonPhoto.new(params[:person_photo])
		@person_photo.person_id = params[:person_id]
		if @person_photo.save
			redirect_to :controller => "organizations", :action => "show", :id => params[:organization_id]
		else
			redirect_to organizations_url
		end
	end
	
	def edit
	end
	
	def update
		PersonPhoto.delete(params[:person_photo_id])
		
		@person_photo = PersonPhoto.new(params[:person_photo])
		@person_photo.person_id = params[:person_id]
		
		if @person_photo.save
			redirect_to :controller => "organizations", :action => "show", :id => params[:organization_id]
		else
			redirect_to organizations_url
		end
	end	
end
